class myState : public TTP::State {
   Name name;

public:
   myState() {
      Register(this, &myState::Say);
      Register(this, &myState::Name);
   }
   
   // Application Methods:
   void saySomethingAsBob(const string& s) {
      cout << "Hello!  I'm saying" << s 
           << "as if I were bob!"  << endl;
      remoteCall(&myState::Say, "bob", s);
   }

   void changeName(const Name& new_name) {
      name = new_name;
      remoteCall(&myState::SetName, nam);
   }

   // RPC Methods:
   void Say(const Name& nam, const string& msg) {
      cout << nam << " says " << msg << endl;
   }

   void SetName(const Name& n) { name = n; }
};
